import pygame
HEIGHT,WIDTH = 1000,1000
class Bullet(pygame.sprite.Sprite):
    def __init__(self):
        #direction
        self.dir_x,self.dir_y = 1,-1
        #speed
        self.speed = 6
        #life
        self.life = False
        #strong
        self.strong = 0

        #shape
        self.l = 15
        self.size = (self.l,self.l)
        self.color = (205,20,125)
        self.surf = pygame.Surface(self.size)
        self.surf.fill(self.color)
        self.rect = self.surf.get_rect()
    
    def move(self):
        self.rect = self.rect.move(self.speed * self.dir_x, self.speed * self.dir_y)
        if self.rect.left <= 0 + 3:
            self.rect.left = 0 + 3
            self.life = False
        elif self.rect.right >= WIDTH - 3:
            self.rect.right = WIDTH - 3
            self.life = False
        if self.rect.top <= 0 + 3:
            self.rect.top = 0
            self.life = False
        elif self.rect.bottom >= HEIGHT- 3:
            self.rect.bottom = HEIGHT- 3
            self.life = False
